package com.hy.wsroom.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
public class Message {
    // 消息类型
    private String type;
    // 内容
    private String content;
    // 发送者
    private String from;
    // 接收者
    private String to;
    // 时间
    private LocalDateTime time = LocalDateTime.now();

    @JsonIgnore
    private Client fromClient;
    @JsonIgnore
    private Client toClient;

    private String roomId;

    // 是否广播
    private boolean broadcast;
}
